﻿CREATE TABLE IF NOT EXISTS [ACCDTBM] (
 [COMP_CODE] nvarchar(10) NOT NULL ,
 [ACC_CODE] nvarchar(20) NOT NULL ,
 [ACC_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ABBR_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_TP_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE01] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE02] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE03] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE04] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE05] nvarchar(10) NULL  DEFAULT NULL,
 [ANAY_FLAG_CODE06] nvarchar(10) NULL  DEFAULT NULL,
 [ACC_OPENING_AMT] decimal(18,6) NULL ,
 [PARENT_ACC_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CASH_FLOW_CLASS] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [INACTIVE_BIT] bit NULL  DEFAULT NULL,
 [ACC_DT_BIT] bit NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (COMP_CODE,ACC_CODE)
);

CREATE TABLE IF NOT EXISTS [ADJDTLM] (
 [ADJ_DT] nvarchar(50) NOT NULL ,
 [ADJ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ADJ_DT)
);

CREATE TABLE IF NOT EXISTS [ADJHDTM] (
 [ADJ_NO] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ADJ_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ADJ_NO)
);

CREATE TABLE IF NOT EXISTS [ALTITEM] (
 [ALT_ITEM] nvarchar(22) NOT NULL ,
 [ASSM_NO] nvarchar(22) NOT NULL ,
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [ALT_LOCX] nvarchar(50) NULL  DEFAULT NULL,
 [ALT_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [ALT_RMKS] ntext NULL  DEFAULT NULL,
 [PRI_CODE] nvarchar(5) NULL  DEFAULT NULL,
 [XCHG_QTY] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ALT_ITEM,ASSM_NO,ITEM_NO)
);

CREATE TABLE IF NOT EXISTS [ANAYTBM] (
 [ANAY_CLASS] nvarchar(50) NOT NULL ,
 [ANAY_CODE] nvarchar(50) NOT NULL ,
 [ANAY_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (ANAY_CLASS,ANAY_CODE)
);

CREATE TABLE IF NOT EXISTS [APMDTLM] (
 [APM_DT] nvarchar(50) NOT NULL ,
 [APM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE] nvarchar(50) NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [APM_CCY_AMT] decimal(18,8) NULL ,
 [APM_DET_AMT] decimal(18,8) NULL ,
 [GL_NO] nvarchar(50) NULL ,
 [APM_RMKS] ntext NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (APM_DT)
);

CREATE TABLE IF NOT EXISTS [APMHDTM] (
 [APM_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DEPOSIT_BIT] bit NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [EFFECT_DATE] datetime NULL ,
 [CHQ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [VIV_DATE] datetime NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [AP_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [PAY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VIV_AMT] decimal(18,8) NULL ,
 [DOC_AMT] decimal(18,8) NULL ,
 [POST_DATE] datetime NULL ,
 [POST_BIT] bit NULL  DEFAULT NULL,
 [GL_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [APM_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (APM_NO)
);

CREATE TABLE IF NOT EXISTS [APRDTLM] (
 [AP_DT] nvarchar(50) NOT NULL ,
 [AP_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE] nvarchar(50) NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [AP_CCY_AMT] decimal(18,8) NULL ,
 [AP_DET_AMT] decimal(18,0) NULL ,
 [GL_NO] nvarchar(50) NULL ,
 [AP_RMKS] ntext NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (AP_DT)
);

CREATE TABLE IF NOT EXISTS [APRHDTM] (
 [AP_NO] nvarchar(50) NOT NULL ,
 [VIV_NO] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_DATE] datetime NULL ,
 [REC_DATE] datetime NULL ,
 [DUE_DATE] datetime NULL ,
 [VIV_DATE] datetime NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [AP_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [PAY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VIV_AMT] decimal(18,8) NULL ,
 [DOC_AMT] decimal(18,8) NULL ,
 [PAYMENT_AMT] decimal(18,8) NULL ,
 [SETTLED_AMT] decimal(18,8) NULL ,
 [AP_CCY_AMT] decimal(18,8) NULL ,
 [AP_DET_AMT] decimal(18,8) NULL ,
 [AP_AMT] decimal(18,8) NULL ,
 [PAY_AMT] decimal(18,8) NULL ,
 [SET_AMT] decimal(18,8) NULL ,
 [POST_DATE] datetime NULL ,
 [POST_BIT] bit NULL  DEFAULT NULL,
 [GL_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [AP_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (AP_NO)
);

CREATE TABLE IF NOT EXISTS [AREDTLM] (
 [ARE_DT] nvarchar(50) NOT NULL ,
 [ARE_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE] nvarchar(50) NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ARE_CCY_AMT] decimal(18,8) NULL ,
 [ARE_DET_AMT] decimal(18,8) NULL ,
 [GL_NO] nvarchar(50) NULL ,
 [ARE_RMKS] ntext NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ARE_DT)
);

CREATE TABLE IF NOT EXISTS [AREHDTM] (
 [ARE_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CHQ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DEPOSIT_BIT] bit NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [EFFECT_DATE] datetime NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_RMKS] ntext NULL  DEFAULT NULL,
 [ARE_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [GL_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ARE_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ARE_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ARE_NO)
);

CREATE TABLE IF NOT EXISTS [ARVDTLM] (
 [AR_DT] nvarchar(50) NOT NULL ,
 [AR_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE] nvarchar(50) NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [AR_CCY_AMT] decimal(18,8) NULL ,
 [AR_DET_AMT] decimal(18,0) NULL ,
 [GL_NO] nvarchar(50) NULL ,
 [AR_RMKS] ntext NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (AR_DT)
);

CREATE TABLE IF NOT EXISTS [ARVHDTM] (
 [AR_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [IV_NO] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [DUE_DATE] datetime NULL ,
 [TRANS_DATE] datetime NULL ,
 [IV_DATE] datetime NULL ,
 [BANK_IN_DATE] datetime NULL ,
 [DN_NO] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_ORD] nvarchar(50) NULL  DEFAULT NULL,
 [CRT_REF_NO] nvarchar(50) NULL  DEFAULT NULL,
 [LC_AMT] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [GL_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [AR_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [AR_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (AR_NO)
);

CREATE TABLE IF NOT EXISTS [ATTRITM] (
 [ATTR_CODE] nvarchar(12) NOT NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ATTR_CODE)
);

CREATE TABLE IF NOT EXISTS [ATVITBM] (
 [ATVIT_CODE] nvarchar(12) NOT NULL ,
 [ATVIT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ATVIT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ATVIT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ATVIT_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ATVIT_RMKS] ntext NULL  DEFAULT NULL,
 [STAGE_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ATVIT_CODE)
);

CREATE TABLE IF NOT EXISTS [AVLMTBM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [VEN_CODE] nvarchar(12) NOT NULL ,
 [CERT_DATE] datetime NULL ,
 [CERT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [STATUS_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,VEN_CODE)
);

CREATE TABLE IF NOT EXISTS [BPNRTBM] (
 [BPN_CODE] nvarchar(50) NOT NULL ,
 [ABBR_NAME] nvarchar(12) NULL  DEFAULT NULL,
 [ACC_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE07] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE08] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE09] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE10] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE11] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE12] nvarchar(50) NULL  DEFAULT NULL,
 [ALIAS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CR_DAY] int NULL ,
 [CR_HOLD] bit NOT NULL ,
 [CR_LIMIT] decimal(15,8) NULL ,
 [CR_START] datetime NULL ,
 [CRTN_DAYS] int NULL ,
 [CRTN_RATE] decimal(18,8) NULL ,
 [CTRY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR05] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR06] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR07] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_ADR08] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_CBL] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_NOTE] ntext NULL  DEFAULT NULL,
 [CUS_SHIPM] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_TITLE] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DISC_RATE] decimal(18,8) NULL ,
 [FORW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ORG_CERT] nvarchar(50) NULL  DEFAULT NULL,
 [PFN_RENG] nvarchar(50) NULL  DEFAULT NULL,
 [REGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SHARE_ACC] nvarchar(1) NULL  DEFAULT NULL,
 [SHIP_MARK01] ntext NULL  DEFAULT NULL,
 [SHIP_MARK02] ntext NULL  DEFAULT NULL,
 [SHORT_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [SIZEG_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [STAF_QTY] decimal(15,8) NULL ,
 [SVIA_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TEL_AREA] nvarchar(50) NULL  DEFAULT NULL,
 [TEL_CTRY] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (BPN_CODE)
);

CREATE TABLE IF NOT EXISTS [BUYERTM] (
 [BUYER_CODE] nvarchar(12) NOT NULL ,
 [BUYER_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [BUYER_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [BUYER_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [BUYER_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [DIRECT_LINE] nvarchar(40) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [MAIL_ADDR] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (BUYER_CODE)
);

CREATE TABLE IF NOT EXISTS [CATRTBM] (
 [CAT_CODE] nvarchar(12) NOT NULL ,
 [ABC_CLASS] nvarchar(22) NULL  DEFAULT NULL,
 [BACK_FLUSH] bit NULL ,
 [CAT_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [CAT_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [CAT_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [CAT_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [CLASS_CODE] nvarchar(22) NULL  DEFAULT NULL,
 [LEAD_TM] decimal(15,8) NULL ,
 [MAX_STK] decimal(15,8) NULL ,
 [MBC_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [MIN_ORD] decimal(15,8) NULL ,
 [MIN_STK] decimal(15,8) NULL ,
 [PKG_ORD] decimal(15,8) NULL ,
 [PO_ODTP] nvarchar(12) NULL  DEFAULT NULL,
 [SCP_FACT] decimal(15,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_ENG] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CAT_CODE)
);

CREATE TABLE IF NOT EXISTS [CCYRTBH] (
 [CCY_CODE] nvarchar(3) NOT NULL ,
 [START_CODE] nvarchar(12) NOT NULL ,
 [START_DATE] datetime NULL ,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CCY_CODE,START_CODE)
);

CREATE TABLE IF NOT EXISTS [CCYRTBM] (
 [CCY_CODE] nvarchar(3) NOT NULL ,
 [CCY_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_SYMBOL] nvarchar(10) NULL  DEFAULT NULL,
 [CCY_CTRY_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [CCY_ABBRE] nvarchar(12) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CCY_CODE)
);

CREATE TABLE IF NOT EXISTS [CENTERM] (
 [CTR_CODE] nvarchar(12) NOT NULL ,
 [CTR_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [CTR_TYPE] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CTR_CODE)
);

CREATE TABLE IF NOT EXISTS [CLASSTM] (
 [CLASS_CODE] nvarchar(22) NOT NULL ,
 [CLASS_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [CLASS_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [CLASS_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [CLASS_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [COLOR_CODE] nvarchar(40) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CLASS_CODE)
);

CREATE TABLE IF NOT EXISTS [CLAXWHM] (
 [CLASS_CODE] nvarchar(12) NOT NULL ,
 [WH_CODE] nvarchar(12) NOT NULL ,
 [ACC_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE07] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE08] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE09] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE10] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE11] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE12] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CLASS_CODE,WH_CODE)
);

CREATE TABLE IF NOT EXISTS [COLORTM] (
 [COLOR_CODE] nvarchar(50) NOT NULL ,
 [COLOR_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [COLOR_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [COLOR_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [COLOR_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COLOR_CODE)
);

CREATE TABLE IF NOT EXISTS [CORPTBM] (
 [CORP_CODE] nvarchar(50) NOT NULL ,
 [CORP_ADDR01] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR02] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR03] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR04] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR05] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR06] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR07] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_ADDR08] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [CORP_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CORP_CODE)
);

CREATE TABLE IF NOT EXISTS [CQTDTLM] (
 [CQT_DT] nvarchar(50) NOT NULL ,
 [CQT_NO] nvarchar(15) NULL  DEFAULT NULL,
 [CQT_DT_RMKS] ntext NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [CQT_REQ_DATE] datetime NULL ,
 [CQT_REQ_QTY] decimal(18,8) NULL ,
 [CQT_UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(22) NULL  DEFAULT NULL,
 [UPDATE_CUS_ITEM] bit NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [CQT_ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CQT_ITEM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (CQT_DT)
);

CREATE TABLE IF NOT EXISTS [CQTHDTM] (
 [CQT_NO] nvarchar(15) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CQT_RMKS] ntext NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [EXPIRY_DATE] datetime NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CQT_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PAY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CQT_REQ_DATE] datetime NULL ,
 [SALES_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SVIA_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CQT_NO)
);

CREATE TABLE IF NOT EXISTS [CTRYTBM] (
 [CTRY_CODE] nvarchar(50) NOT NULL ,
 [CTRY_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CTRY_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CTRY_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [CTRY_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CTRY_CODE)
);

CREATE TABLE IF NOT EXISTS [CUSITEM] (
 [CUS_CODE] nvarchar(50) NOT NULL ,
 [CUS_ITEM] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [BAR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CRTN_AMT] decimal(18,8) NULL ,
 [CRTN_DATE] datetime NULL ,
 [CRTN_QTY] decimal(18,8) NULL ,
 [CRTN_RATE] decimal(18,8) NULL ,
 [DISC_RATE] decimal(18,8) NULL ,
 [EAN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME1] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME2] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME3] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME4] nvarchar(50) NULL  DEFAULT NULL,
 [L_CQ_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_CQ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [L_CQ_REQ_DATE] datetime NULL ,
 [L_CQ_REQ_QTY] decimal(18,8) NULL ,
 [L_CQ_UNIT_PRICE] decimal(18,8) NULL ,
 [L_CQ_UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_CQ_XCHG_RATE] decimal(18,8) NULL ,
 [L_SO_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_SO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [L_SO_REC_DATE] datetime NULL ,
 [L_SO_REC_QTY] decimal(18,8) NULL ,
 [L_SO_REC_WH] nvarchar(50) NULL  DEFAULT NULL,
 [L_SO_REQ_QTY] decimal(18,8) NULL ,
 [L_SO_RTV_DATE] datetime NULL ,
 [L_SO_RTV_QTY] nvarchar(10) NULL  DEFAULT NULL,
 [L_SO_UNIT_PRICE] decimal(18,8) NULL ,
 [L_SO_UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_SO_XCHG_RATE] decimal(18,8) NULL ,
 [MADJ_RATE] decimal(18,8) NULL ,
 [REGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [RTAL_PRICE] decimal(18,8) NULL ,
 [SALE_BPRICE] decimal(15,8) NULL ,
 [SALE_CCY] nvarchar(50) NULL  DEFAULT NULL,
 [SALE_UPRICE] decimal(15,8) NULL ,
 [STD_CCY] nvarchar(50) NULL  DEFAULT NULL,
 [STD_UPRICE] decimal(15,8) NULL ,
 [T_CO_REQ_QTY] decimal(18,8) NULL ,
 [T_SO_REQ_AMT] decimal(18,8) NULL ,
 [T_SO_RTV_QTY] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UPC_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CUS_CODE,CUS_ITEM,ITEM_NO)
);

CREATE TABLE IF NOT EXISTS [DELYTBM] (
 [DELY_CODE] nvarchar(50) NOT NULL ,
 [CTRY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CBL] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_PORT] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DELY_CODE)
);

CREATE TABLE IF NOT EXISTS [DIMTBLM] (
 [ITEM_NO] nvarchar(50) NOT NULL ,
 [CTN_NW] decimal(18,8) NULL ,
 [CTN_GW] decimal(18,8) NULL ,
 [INN_NW] decimal(18,8) NULL ,
 [INN_GW] decimal(18,8) NULL ,
 [INN_L] decimal(18,8) NULL ,
 [INN_W] decimal(18,8) NULL ,
 [INN_H] decimal(18,8) NULL ,
 [CTN_QTY] decimal(18,8) NULL ,
 [INN_QTY] decimal(18,8) NULL ,
 [CTN_L] decimal(18,8) NULL ,
 [CTN_W] decimal(18,8) NULL ,
 [CTN_H] decimal(18,8) NULL ,
 [CTN_CBM] decimal(18,8) NULL ,
 [CTN_CFT] decimal(18,8) NULL ,
 [INN_CBM] decimal(18,8) NULL ,
 [INN_CFT] decimal(18,8) NULL ,
 [UOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UOD_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO)
);

CREATE TABLE IF NOT EXISTS [DNRDTLM] (
 [DN_DT] nvarchar(18) NOT NULL ,
 [TRANS_CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DN_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [TRANS_REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_SO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_SO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DXC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_XCHG_RATE] decimal(18,8) NULL ,
 [SERIAL_NO] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DN_DT)
);

CREATE TABLE IF NOT EXISTS [DNRHDTM] (
 [DN_NO] nvarchar(50) NOT NULL ,
 [TRANS_CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DN_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_XCHG_RATE] decimal(15,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DN_NO)
);

CREATE TABLE IF NOT EXISTS [DORDTLM] (
 [DO_DT] nvarchar(20) NOT NULL ,
 [SERIAL_NO] int NULL ,
 [DN_REQ_QTY] decimal(20,8) NULL ,
 [DO_NO] nvarchar(20) NULL  DEFAULT NULL,
 [DO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [DO_REQ_DATE] datetime NULL ,
 [DO_REQ_QTY] decimal(18,8) NULL ,
 [SO_NO] nvarchar(20) NULL  DEFAULT NULL,
 [SO_DT] nvarchar(18) NULL  DEFAULT NULL,
 [IV_REQ_QTY] decimal(20,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DO_DT)
);

CREATE TABLE IF NOT EXISTS [DORHDTM] (
 [DO_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [BPN_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(20) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [DO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [SVIA_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DO_NO)
);

CREATE TABLE IF NOT EXISTS [EBOMTBM] (
 [ASSM_NO] nvarchar(22) NOT NULL ,
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [BOM_LOCX] ntext NULL  DEFAULT NULL,
 [BOM_RMKS] ntext NULL  DEFAULT NULL,
 [BOM_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [ENG_QPE] decimal(18,8) NULL ,
 [ECN_NO] nvarchar(22) NULL  DEFAULT NULL,
 [QTY_PER] decimal(18,8) NULL ,
 [WASTAGE_RATE] decimal(18,8) NULL ,
 [SCRAP_RATE] decimal(18,8) NULL ,
 [UOM_ENG] nvarchar(8) NULL  DEFAULT NULL,
 [UOM_EXG] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ASSM_NO,ITEM_NO)
);

CREATE TABLE IF NOT EXISTS [ECNDTLM] (
 [ECN_DT] nvarchar(20) NOT NULL ,
 [ALT_ITEM] nvarchar(22) NULL  DEFAULT NULL,
 [ASSM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [ECN_ATVT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ECN_LOCX] nvarchar(50) NULL  DEFAULT NULL,
 [ECN_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ECN_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [ECN_RMKS] ntext NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [QTY_PER] decimal(18,8) NULL ,
 [UOM_ENG] nvarchar(50) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ENG_QPE] decimal(18,0) NULL ,
 [SERIAL_NO] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [WASTAGE_RATE] decimal(20,8) NULL ,
 [SCRAP_RATE] decimal(20,8) NULL ,
 PRIMARY KEY (ECN_DT)
);

CREATE TABLE IF NOT EXISTS [ECNHDTM] (
 [ECN_NO] nvarchar(20) NOT NULL ,
 [ECN_DATE] datetime NULL ,
 [ECN_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ECN_NO)
);

CREATE TABLE IF NOT EXISTS [FGNDTLM] (
 [FG_DT] nvarchar(50) NOT NULL ,
 [BOOK_AMT] decimal(18,8) NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DISC_RATE] decimal(18,8) NULL ,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FG_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_ADJ] decimal(18,8) NULL ,
 [TRANS_AMT] decimal(18,8) NULL ,
 [TRANS_BAM] decimal(18,8) NULL ,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_DDC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_WO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DXC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_TDC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TOC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TXC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WH_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (FG_DT)
);

CREATE TABLE IF NOT EXISTS [FGNHDTM] (
 [FG_NO] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [FGN_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WH_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (FG_NO)
);

CREATE TABLE IF NOT EXISTS [FORWTBM] (
 [FORW_CODE] nvarchar(50) NOT NULL ,
 [FORW_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_CBL] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [REGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (FORW_CODE)
);

CREATE TABLE IF NOT EXISTS [GRNDTLM] (
 [REC_DT] nvarchar(50) NOT NULL ,
 [BOOK_AMT] decimal(18,8) NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DISC_RATE] decimal(18,8) NULL ,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_ADJ] decimal(18,8) NULL ,
 [TRANS_AMT] decimal(18,8) NULL ,
 [TRANS_BAM] decimal(18,8) NULL ,
 [TRANS_PO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_PO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DXC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_TDC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TOC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TXC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REC_DT)
);

CREATE TABLE IF NOT EXISTS [GRNHDTM] (
 [REC_NO] nvarchar(50) NOT NULL ,
 [TRANS_CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [GRN_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REC_NO)
);

CREATE TABLE IF NOT EXISTS [HANDTBM] (
 [HAND_CODE] nvarchar(12) NOT NULL ,
 [DIRECT_LINE] nvarchar(50) NULL  DEFAULT NULL,
 [HAND_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [HAND_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [HAND_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [HAND_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [MAIL_ADDR] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (HAND_CODE)
);

CREATE TABLE IF NOT EXISTS [ITEMATM] (
 [ITEM_NO] nvarchar(50) NOT NULL ,
 [ATTR_CODE] nvarchar(50) NOT NULL ,
 [ATTR_VALUE] nvarchar(100) NULL  DEFAULT NULL,
 [ATTR_RMKS] ntext NULL  DEFAULT NULL,
 [XDIR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,ATTR_CODE)
);

CREATE TABLE IF NOT EXISTS [ITEMTPM] (
 [ITEMTP_CODE] nvarchar(50) NOT NULL ,
 [ITEMTP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ITEMTP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ITEMTP_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ITEMTP_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEMTP_CODE)
);

CREATE TABLE IF NOT EXISTS [IVRDTLM] (
 [IV_DT] nvarchar(50) NOT NULL ,
 [ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE07] nvarchar(50) NULL  DEFAULT NULL,
 [ANAY_CODE08] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [DO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [IV_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [IV_REQ_DATE] datetime NULL ,
 [IV_UNIT_PRICE] decimal(18,8) NULL ,
 [IV_REQ_QTY] decimal(18,8) NULL ,
 [SO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [SO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [IV_DT_RMKS] ntext NULL  DEFAULT NULL,
 [IV_DELY_DATE] datetime NULL ,
 PRIMARY KEY (IV_DT)
);

CREATE TABLE IF NOT EXISTS [IVRHDTM] (
 [IV_NO] nvarchar(15) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [BPN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [IV_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [CUS_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [BILL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SVIA_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [XCHG_RATE] decimal(18,8) NULL ,
 [PORT_FM] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_TO] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [IV_ETA_DATE] datetime NULL ,
 [IV_ETD_DATE] datetime NULL ,
 [IV_DUE_DATE] datetime NULL ,
 [IV_TRANS_DATE] datetime NULL ,
 [IV_REQ_DATE] datetime NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (IV_NO)
);

CREATE TABLE IF NOT EXISTS [LCBANKM] (
 [LCBK_CODE] nvarchar(50) NOT NULL ,
 [LCBK_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [LCBK_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [LCBK_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [LCBK_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LCBK_CODE)
);

CREATE TABLE IF NOT EXISTS [LCRDTLM] (
 [LC_DT] nvarchar(50) NOT NULL ,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [LC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [LC_RMKS] ntext NULL  DEFAULT NULL,
 [REQ_DATE] datetime NULL ,
 [REQ_QTY] decimal(18,8) NULL ,
 [XREF_DDC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC08] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC08] nvarchar(20) NULL  DEFAULT NULL,
 [XWO_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LC_DT)
);

CREATE TABLE IF NOT EXISTS [LCRHDTM] (
 [LC_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_ORD] nvarchar(50) NULL  DEFAULT NULL,
 [EXPIRE_DATE] datetime NULL ,
 [ISSUE_DATE] datetime NULL ,
 [BLANK_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LC_NO)
);

CREATE TABLE IF NOT EXISTS [LOCATBM] (
 [LOC_CODE] nvarchar(20) NOT NULL ,
 [LOC_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [LOC_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [LOC_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [LOC_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LOC_CODE)
);

CREATE TABLE IF NOT EXISTS [LOTMTBM] (
 [TRANS_UDFX6] nvarchar(20) NOT NULL ,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [LOT_DDC] nvarchar(18) NULL  DEFAULT NULL,
 [LOT_DOC] nvarchar(18) NULL  DEFAULT NULL,
 [LOT_RMKS] ntext NULL  DEFAULT NULL,
 [LOT_DATE01] datetime NULL ,
 [LOT_DATE02] datetime NULL ,
 [LOT_DATE03] datetime NULL ,
 [LOT_DATE04] datetime NULL ,
 [LOT_DATE05] datetime NULL ,
 [ODTP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [BOOK_PRICE] decimal(18,8) NULL ,
 [XCHG_RATE] decimal(18,8) NULL ,
 [CCY_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [CLOSE_BIT] bit NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TRANS_UDFX6)
);

CREATE TABLE IF NOT EXISTS [MBOXTBM] (
 [MBOX_ID] nvarchar(18) NOT NULL ,
 [MBOX_SENDER] nvarchar(255) NULL  DEFAULT NULL,
 [MBOX_TITLE] nvarchar(255) NULL  DEFAULT NULL,
 [MBOX_INCEPT_CC] ntext NULL  DEFAULT NULL,
 [MBOX_INCEPT_BCC] ntext NULL  DEFAULT NULL,
 [MBOX_INCEPT] ntext NULL  DEFAULT NULL,
 [MBOX_CONTENT] ntext NULL  DEFAULT NULL,
 [MBOX_XDIR] nvarchar(18) NULL  DEFAULT NULL,
 [READ_BIT] bit NULL  DEFAULT NULL,
 [SENT_BIT] bit NULL  DEFAULT NULL,
 [TRY_TIMES] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MBOX_ID)
);

CREATE TABLE IF NOT EXISTS [MIRDTLM] (
 [MI_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [MI_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_WO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_WO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MI_DT)
);

CREATE TABLE IF NOT EXISTS [MIRHDTM] (
 [MI_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MI_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MI_NO)
);

CREATE TABLE IF NOT EXISTS [MMIDTLM] (
 [MMI_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [MMI_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MMI_DT)
);

CREATE TABLE IF NOT EXISTS [MMIHDTM] (
 [MMI_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MMI_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MMI_NO)
);

CREATE TABLE IF NOT EXISTS [MMRDTLM] (
 [MM_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [MM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MM_DT)
);

CREATE TABLE IF NOT EXISTS [MMRHDTM] (
 [MM_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MM_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 PRIMARY KEY (MM_NO)
);

CREATE TABLE IF NOT EXISTS [MODDTLM] (
 [MOLD_DT] nvarchar(50) NOT NULL ,
 [MOLD_AUXI] nvarchar(5) NULL  DEFAULT NULL,
 [MOLD_CAVITY] int NULL ,
 [MOLD_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_MARK01] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_MARK02] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_MARK03] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_MARK04] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_NO] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_NW] int NULL ,
 [MOLD_SERI] int NULL ,
 [MOLD_XREV] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MOLD_DT)
);

CREATE TABLE IF NOT EXISTS [MODHDTM] (
 [MOLD_CODE] nvarchar(50) NOT NULL ,
 [CAT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CAV_QTY] int NULL ,
 [CUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CUS_MOLD] nvarchar(50) NULL  DEFAULT NULL,
 [INHS_DATE] datetime NULL ,
 [MAKE_DATE] datetime NULL ,
 [MOLD_CLASS] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_GW] int NULL ,
 [MOLD_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [NOOF_AVAIL] int NULL ,
 [NOOF_SHOT] int NULL ,
 [PROJ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MOLD_CODE)
);

CREATE TABLE IF NOT EXISTS [MORDTLM] (
 [MO_DT] nvarchar(18) NOT NULL ,
 [SERIAL_NO] int NULL ,
 [CTR_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [MO_NO] nvarchar(18) NULL  DEFAULT NULL,
 [MO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [MO_REQ_DATE] datetime NULL ,
 [MO_REQ_QTY] decimal(18,8) NULL ,
 [MO_START_DATE] datetime NULL ,
 [MO_WO_QTY] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MO_DT)
);

CREATE TABLE IF NOT EXISTS [MORHDTM] (
 [MO_NO] nvarchar(18) NOT NULL ,
 [COMP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [MO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MO_NO)
);

CREATE TABLE IF NOT EXISTS [MRVDTLM] (
 [MR_DT] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [MR_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MR_REQ_DATE] datetime NULL ,
 [MR_REQ_QTY] decimal(18,8) NULL ,
 [MR_DT_RMKS] ntext NULL  DEFAULT NULL,
 [WO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [MR_MI_QTY] decimal(18,8) NULL ,
 [MR_MI_AMT] decimal(18,8) NULL ,
 PRIMARY KEY (MR_DT)
);

CREATE TABLE IF NOT EXISTS [MRVHDTM] (
 [MR_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [MR_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [MR_ODTP_DATE] datetime NULL ,
 [REQ_QTY] decimal(18,8) NULL ,
 [WO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [XFG_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (MR_NO)
);

CREATE TABLE IF NOT EXISTS [PARTBLM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [ITEM_ABBR_NAME] nvarchar(12) NULL  DEFAULT NULL,
 [ABC_CLASS_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ITEM_ALIAS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_AUX_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CAT_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [CLASS_CODE] nvarchar(22) NULL  DEFAULT NULL,
 [ITEM_DRWG_NO] nvarchar(50) NULL  DEFAULT NULL,
 [EXPIRY_DAY] int NULL ,
 [HAND_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME05] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_TP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [LEAD_TM] int NULL ,
 [MBC_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [MIN_ORD] decimal(18,8) NULL ,
 [MIN_STK] decimal(18,8) NULL ,
 [PKG_ORD] decimal(18,8) NULL ,
 [PROJ_NO] nvarchar(22) NULL  DEFAULT NULL,
 [STATUS_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(8) NULL  DEFAULT NULL,
 [UOM_ENG] nvarchar(8) NULL  DEFAULT NULL,
 [ITEM_RMKS] ntext NULL  DEFAULT NULL,
 [PHANTOM_BIT] bit NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO)
);

CREATE TABLE IF NOT EXISTS [PMTCDTM] (
 [PMT_CODE] nvarchar(50) NOT NULL ,
 [PMT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PMT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PMT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PMT_AMS_BIT] bit NOT NULL ,
 [PMT_CR_DAY] decimal(18,0) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PMT_CODE)
);

CREATE TABLE IF NOT EXISTS [PNACDTM] (
 [PN_NET_CODE] nvarchar(36) NOT NULL ,
 [PN_A_CODE] nvarchar(36) NOT NULL ,
 [PN_A_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PN_T_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_P_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_A_CLASS] nvarchar(32) NULL  DEFAULT NULL,
 [PN_A_IF_DATA] ntext NULL  DEFAULT NULL,
 [PN_A_DIR] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_NET_CODE,PN_A_CODE)
);

CREATE TABLE IF NOT EXISTS [PNCZTBM] (
 [PN_WCZ_CODE] nvarchar(36) NOT NULL ,
 [PN_NET_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_WCZ_CONTEXT] ntext NULL  DEFAULT NULL,
 [PN_WCZ_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [PN_START_DATE] datetime NULL ,
 [PN_FINAL_DATE] datetime NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [PN_NET_CONTEXT] ntext NULL  DEFAULT NULL,
 [PN_DATA_CODE] nvarchar(36) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_WCZ_CODE)
);

CREATE TABLE IF NOT EXISTS [PNMSGTM] (
 [UID_CODE] nvarchar(36) NOT NULL ,
 [ACCESS_RT_CODE] nvarchar(36) NOT NULL ,
 [PN_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UID_CODE,ACCESS_RT_CODE)
);

CREATE TABLE IF NOT EXISTS [PNNCDTM] (
 [PN_NET_CODE] nvarchar(36) NOT NULL ,
 [PN_NET_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PN_NET_RMKS] ntext NULL  DEFAULT NULL,
 [PN_NET_MSG] ntext NULL  DEFAULT NULL,
 [PN_NET_START_DATE] datetime NULL ,
 [PN_NET_FINAL_DATE] datetime NULL ,
 [PN_NET_ATVT_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [PN_NET_ATV_YN] bit NULL  DEFAULT NULL,
 [PN_NET_CONTEXT] ntext NULL  DEFAULT NULL,
 [PN_TP_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_NET_CODE)
);

CREATE TABLE IF NOT EXISTS [PNPCDTM] (
 [PN_NET_CODE] nvarchar(36) NOT NULL ,
 [PN_P_CODE] nvarchar(36) NOT NULL ,
 [PN_P_CLASS] nvarchar(2) NULL  DEFAULT NULL,
 [PN_P_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PN_P_RMKS] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_NET_CODE,PN_P_CODE)
);

CREATE TABLE IF NOT EXISTS [PNSIGNM] (
 [PN_WCZ_CODE] nvarchar(36) NOT NULL ,
 [PN_SIGN_CODE] nvarchar(36) NOT NULL ,
 [PN_NET_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_P_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_SIGN_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [PN_CONTEXT] ntext NULL  DEFAULT NULL,
 [PN_ENTER_DATE] datetime NULL ,
 [PN_LEAVE_DATE] datetime NULL ,
 [PN_CANCELLED_DATE] datetime NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [PN_DATA_CODE] nvarchar(36) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_WCZ_CODE,PN_SIGN_CODE)
);

CREATE TABLE IF NOT EXISTS [PNTCDTM] (
 [PN_NET_CODE] nvarchar(36) NOT NULL ,
 [PN_T_CODE] nvarchar(36) NOT NULL ,
 [PN_T_RMKS] ntext NULL  DEFAULT NULL,
 [PN_T_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PN_T_TP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PN_T_TRIG] nvarchar(15) NULL  DEFAULT NULL,
 [PN_T_EXPIRY] int NULL ,
 [PN_ATV_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [APPV_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_NET_CODE,PN_T_CODE)
);

CREATE TABLE IF NOT EXISTS [PNTPCDM] (
 [PN_TP_CODE] nvarchar(36) NOT NULL ,
 [PN_TP_RMKS] ntext NULL  DEFAULT NULL,
 [PN_TP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PN_TP_CODE)
);

CREATE TABLE IF NOT EXISTS [PNWKTBM] (
 [PN_WCZ_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_WKT_CODE] nvarchar(36) NOT NULL ,
 [PN_NET_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_T_CODE] nvarchar(36) NULL  DEFAULT NULL,
 [PN_WKT_CONTEXT] ntext NULL  DEFAULT NULL,
 [PN_ATVT_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [PN_WKT_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [PN_ENABLED_DATE] datetime NULL ,
 [PN_FINISHED_DATE] datetime NULL ,
 [PN_CANCELLED_DATE] datetime NULL ,
 [PN_DEADLINE_DATE] datetime NULL ,
 [PN_USER_ID] nvarchar(50) NULL  DEFAULT NULL,
 [PN_APPV_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [PN_DATA_CODE] nvarchar(32) NULL  DEFAULT NULL,
 [PN_WKT_RMKS] ntext NULL  DEFAULT NULL,
 PRIMARY KEY (PN_WKT_CODE)
);

CREATE TABLE IF NOT EXISTS [PORDIVM] (
 [PO_DIV] nvarchar(50) NOT NULL ,
 [PO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_DATE] datetime NULL ,
 [REQ_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PO_DIV)
);

CREATE TABLE IF NOT EXISTS [PORDTLE] (
 [PO_DT] nvarchar(50) NOT NULL ,
 [PO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [PO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [PU_REQ_QTY] decimal(18,8) NULL ,
 [PO_BAL_QTY] decimal(18,8) NULL ,
 [PO_REQ_DATE] datetime NULL ,
 [PO_REQ_QTY] decimal(18,8) NULL ,
 [PO_RTV_QTY] decimal(18,8) NULL ,
 [PO_REC_QTY] decimal(18,8) NULL ,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [PU_UNIT_PRICE] decimal(18,8) NULL ,
 [PO_UNIT_PRICE] decimal(18,8) NULL ,
 [UNIT_RATE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [PU_UOM_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [PO_ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME05] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (PO_DT)
);

CREATE TABLE IF NOT EXISTS [PORDTLH] (
 [XREV_NO] nvarchar(20) NOT NULL ,
 [XVER_CONTENT] ntext NULL  DEFAULT NULL,
 [PO_DT] nvarchar(50) NOT NULL ,
 [PO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [PO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [PU_REQ_QTY] decimal(18,8) NULL ,
 [PO_BAL_QTY] decimal(18,8) NULL ,
 [PO_REQ_DATE] datetime NULL ,
 [PO_REQ_QTY] decimal(18,8) NULL ,
 [PO_RTV_QTY] decimal(18,8) NULL ,
 [PO_REC_QTY] decimal(18,8) NULL ,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [PU_UNIT_PRICE] decimal(18,8) NULL ,
 [PO_UNIT_PRICE] decimal(18,8) NULL ,
 [UNIT_RATE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [PU_UOM_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [PO_ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [PO_ITEM_NAME05] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (XREV_NO,PO_DT)
);

CREATE TABLE IF NOT EXISTS [PORDTLM] (
 [PO_DT] nvarchar(18) NOT NULL ,
 [PO_NO] nvarchar(18) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [PO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [PU_REQ_QTY] decimal(18,8) NULL ,
 [PO_BAL_QTY] decimal(18,8) NULL ,
 [PO_REQ_DATE] datetime NULL ,
 [PO_REQ_QTY] decimal(18,8) NULL ,
 [PO_RTV_QTY] decimal(18,8) NULL ,
 [PO_REC_QTY] decimal(18,8) NULL ,
 [TRANS_UDFX1] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(12) NULL  DEFAULT NULL,
 [PU_UNIT_PRICE] decimal(18,8) NULL ,
 [PO_UNIT_PRICE] decimal(18,8) NULL ,
 [UNIT_RATE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [PU_UOM_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [PO_ITEM_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [PO_ITEM_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [PO_ITEM_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [PO_ITEM_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [PO_ITEM_NAME05] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PO_DT)
);

CREATE TABLE IF NOT EXISTS [PORHDTE] (
 [PO_NO] nvarchar(50) NOT NULL ,
 [APPV_WAIT] nvarchar(50) NULL  DEFAULT NULL,
 [BUGT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [BUYER_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DISC_FAT] decimal(19,8) NULL ,
 [ODTP_AMT] decimal(15,8) NULL ,
 [ODTP_APPV] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NOT NULL ,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_SRC] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PORT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_DATE] datetime NULL ,
 [SITE_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [VEN_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_VIA] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [XREF_DDC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC08] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC08] nvarchar(20) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PO_NO)
);

CREATE TABLE IF NOT EXISTS [PORHDTH] (
 [XREV_NO] nvarchar(20) NOT NULL ,
 [PO_NO] nvarchar(50) NOT NULL ,
 [APPV_WAIT] nvarchar(50) NULL  DEFAULT NULL,
 [BUGT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [BUYER_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DISC_FAT] decimal(19,8) NULL ,
 [ODTP_AMT] decimal(15,8) NULL ,
 [ODTP_APPV] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NOT NULL ,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_SRC] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PORT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_DATE] datetime NULL ,
 [SITE_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [VEN_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_VIA] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [XREF_DDC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DDC08] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC01] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC02] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC03] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC04] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC05] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC06] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC07] nvarchar(20) NULL  DEFAULT NULL,
 [XREF_DOC08] nvarchar(20) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (XREV_NO,PO_NO)
);

CREATE TABLE IF NOT EXISTS [PORHDTM] (
 [PO_NO] nvarchar(15) NOT NULL ,
 [BUYER_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [DISC_FAT] decimal(19,8) NULL ,
 [ODTP_AMT] decimal(15,8) NULL ,
 [ODTP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PO_ODTP_RMKS01] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(15) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PORT_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PTERM_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PO_REQ_DATE] datetime NULL ,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [PO_PMT_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [SVIA_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PO_VAT_TAX] decimal(20,8) NULL ,
 [PO_PI_NO] nvarchar(15) NULL  DEFAULT NULL,
 [PO_FI_NO] nvarchar(15) NULL  DEFAULT NULL,
 [PO_ODTP_RMKS02] ntext NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PO_NO)
);

CREATE TABLE IF NOT EXISTS [PORTBLM] (
 [PORT_CODE] nvarchar(50) NOT NULL ,
 [CTRY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [FORW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PORT_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PORT_CODE)
);

CREATE TABLE IF NOT EXISTS [PPODTLM] (
 [PPO_DT] nvarchar(18) NOT NULL ,
 [ACCEPT_BIT] bit NULL ,
 [BUYER_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [PPO_NO] nvarchar(15) NOT NULL ,
 [PPO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [PU_REQ_QTY] decimal(18,8) NULL ,
 [LEAD_TM] decimal(18,0) NULL ,
 [PKG_ORD] decimal(18,0) NULL ,
 [PPO_REQ_DATE] datetime NULL ,
 [PPO_REQ_QTY] decimal(18,8) NULL ,
 [ORG_DATE] datetime NULL ,
 [ORG_QTY] decimal(18,0) NULL ,
 [PPO_UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [PU_UOM_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [PU_UNIT_PRICE] decimal(20,8) NULL ,
 [SERIAL_NO] int NULL ,
 [VEN_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PPO_DT)
);

CREATE TABLE IF NOT EXISTS [PPOHDTM] (
 [PPO_NO] nvarchar(15) NOT NULL ,
 [ODTP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [PPO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(15) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PPO_NO)
);

CREATE TABLE IF NOT EXISTS [PROJTBM] (
 [PROJ_NO] nvarchar(22) NOT NULL ,
 [FINAL_DATE] datetime NULL ,
 [PROJ_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PROJ_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PROJ_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PROJ_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [START_DATE] datetime NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PROJ_NO)
);

CREATE TABLE IF NOT EXISTS [PROJTPM] (
 [PJTP_CODE] nvarchar(22) NOT NULL ,
 [PJTP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PJTP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PJTP_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PJTP_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [PJTP_RMKS] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PJTP_CODE)
);

CREATE TABLE IF NOT EXISTS [PRVDTLM] (
 [PR_DT] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [PR_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_DATE] datetime NULL ,
 [REQ_QTY] decimal(18,8) NULL ,
 [PR_RMKS] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PR_DT)
);

CREATE TABLE IF NOT EXISTS [PRVHDTM] (
 [PR_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PR_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [REQ_DATE] datetime NULL ,
 [REQ_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PR_NO)
);

CREATE TABLE IF NOT EXISTS [PSCDTLM] (
 [PSC_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DIFF_QTY] decimal(18,8) NULL ,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [PSC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [STK_QTY] decimal(18,8) NULL ,
 [TAG_QTY] decimal(18,8) NULL ,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PSC_DT)
);

CREATE TABLE IF NOT EXISTS [PSCHDTM] (
 [PSC_NO] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PSC_NO)
);

CREATE TABLE IF NOT EXISTS [PTERMTM] (
 [PTERM_CODE] nvarchar(12) NOT NULL ,
 [PTERM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [PTERM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PTERM_CODE)
);

CREATE TABLE IF NOT EXISTS [PWODTLM] (
 [PWO_DT] nvarchar(50) NOT NULL ,
 [PWO_NO] nvarchar(50) NOT NULL ,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PWO_DT)
);

CREATE TABLE IF NOT EXISTS [PWOHDTM] (
 [PWO_NO] nvarchar(50) NOT NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PWO_NO)
);

CREATE TABLE IF NOT EXISTS [REASNTM] (
 [REASN_CODE] nvarchar(12) NOT NULL ,
 [REASN_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [REASN_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [REASN_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [REASN_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REASN_CODE)
);

CREATE TABLE IF NOT EXISTS [REGNCDM] (
 [REGN_CODE] nvarchar(15) NOT NULL ,
 [REGN_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [REGN_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [REGN_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [REGN_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REGN_CODE)
);

CREATE TABLE IF NOT EXISTS [REMKTBM] (
 [REMK_CODE] nvarchar(18) NOT NULL ,
 [REMK_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [REMK_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [REMK_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [REMK_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [REMK_CONTENT] ntext NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REMK_CODE)
);

CREATE TABLE IF NOT EXISTS [SALESTM] (
 [SALES_CODE] nvarchar(12) NOT NULL ,
 [DIRECT_LINE] nvarchar(50) NULL  DEFAULT NULL,
 [JOIN_DATE] datetime NULL ,
 [MAIL_ADDR] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_GROUP] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [SALES_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SALES_CODE)
);

CREATE TABLE IF NOT EXISTS [SALTERM] (
 [SALES_TERM] nvarchar(50) NOT NULL ,
 [TERM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [TERM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [TERM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [TERM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SALES_TERM)
);

CREATE TABLE IF NOT EXISTS [SCPDTLM] (
 [SCP_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [SCP_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SCP_DT)
);

CREATE TABLE IF NOT EXISTS [SCPHDTM] (
 [SCP_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SCP_NO)
);

CREATE TABLE IF NOT EXISTS [SEGMTBM] (
 [SEGM_CODE] nvarchar(12) NOT NULL ,
 [LAST_NO] int NULL ,
 [SEGM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [SEGM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [SEGM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [SEGM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [SEGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SEGN_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [SEGN_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [SEGN_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [SEGN_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [VERSION_BIT] bit NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SEGM_CODE)
);

CREATE TABLE IF NOT EXISTS [SIZECDM] (
 [SIZE_CODE] nvarchar(50) NOT NULL ,
 [SIZE_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [SIZE_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [SIZE_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [SIZE_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SIZE_CODE)
);

CREATE TABLE IF NOT EXISTS [SORDTLM] (
 [SO_DT] nvarchar(18) NOT NULL ,
 [DN_REQ_QTY] decimal(18,8) NULL ,
 [DO_REQ_QTY] decimal(18,8) NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [IV_REQ_QTY] decimal(18,8) NULL ,
 [SO_REQ_QTY] decimal(18,8) NULL ,
 [SO_UNIT_PRICE] decimal(18,8) NULL ,
 [SO_REQ_DATE] datetime NULL ,
 [SO_NO] nvarchar(18) NULL  DEFAULT NULL,
 [SO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [SO_ETA_DATE] datetime NULL ,
 [SO_ETD_DATE] datetime NULL ,
 [MK_REQ_QTY] decimal(20,8) NULL ,
 [MK_REQ_DATE] datetime NULL ,
 [MK_UNIT_PRICE] decimal(20,8) NULL ,
 [DISCOUNT_RATE] decimal(20,8) NULL ,
 [CUS_ITEM_NO] nvarchar(18) NULL  DEFAULT NULL,
 [CUS_ITEM_NAME01] nvarchar(18) NULL  DEFAULT NULL,
 [UOM_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [MK_UOM_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SO_DT)
);

CREATE TABLE IF NOT EXISTS [SORHDTM] (
 [SO_NO] nvarchar(15) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [BPN_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [CUS_ORD] nvarchar(15) NULL  DEFAULT NULL,
 [CUS_TERM] nvarchar(15) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [ODTP_AMT] decimal(18,8) NULL ,
 [ODTP_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [SO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(10) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PTERM_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [REGN_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [SO_REQ_DATE] datetime NULL ,
 [CUS_REFX] nvarchar(18) NULL  DEFAULT NULL,
 [ORG_CTRY] nvarchar(18) NULL  DEFAULT NULL,
 [ORG_CERT] nvarchar(18) NULL  DEFAULT NULL,
 [DISCOUNT_RATE] decimal(20,8) NULL ,
 [TAX_RATE] decimal(20,8) NULL ,
 [SALES_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [SVIA_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SO_NO)
);

CREATE TABLE IF NOT EXISTS [STAGETM] (
 [STAGE_CODE] nvarchar(50) NOT NULL ,
 [STAGE_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [STAGE_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [STAGE_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [STAGE_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (STAGE_CODE)
);

CREATE TABLE IF NOT EXISTS [STKRTBM] (
 [STK_DT] nvarchar(18) NOT NULL ,
 [SERIAL_NO] int NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [EXPIRE_DATE] datetime NULL ,
 [IN_DATE] datetime NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [LOCK_BIT] bit NOT NULL ,
 [NET_STK] decimal(15,8) NULL ,
 [STK_AMT] decimal(19,8) NULL ,
 [STK_QTY] decimal(19,8) NULL ,
 [STK_QTY2] decimal(19,8) NULL ,
 [TRANS_UDFX1] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(12) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(12) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(15,8) NULL ,
 [WH_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (STK_DT)
);

CREATE TABLE IF NOT EXISTS [SVIATBM] (
 [SVIA_CODE] nvarchar(18) NOT NULL ,
 [SVIA_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [SVIA_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [SVIA_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [SVIA_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SVIA_CODE)
);

CREATE TABLE IF NOT EXISTS [TMRDTLM] (
 [TM_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFN1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TM_DT)
);

CREATE TABLE IF NOT EXISTS [TMRHDTM] (
 [TM_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TM_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WH_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TM_NO)
);

CREATE TABLE IF NOT EXISTS [TPRDTLM] (
 [TP_DT] nvarchar(50) NOT NULL ,
 [CYCLE_TIME] int NULL ,
 [ITEM_IJ] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [ITEM_PM] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_AUXI] nvarchar(50) NULL  DEFAULT NULL,
 [MOLD_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REG_RIND] decimal(18,8) NULL ,
 [TP_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TP_RMK] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TP_DT)
);

CREATE TABLE IF NOT EXISTS [TPRHDTM] (
 [TP_NO] nvarchar(20) NOT NULL ,
 [ASSM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TP_NO)
);

CREATE TABLE IF NOT EXISTS [TRANCDM] (
 [TRANS_CODE] nvarchar(8) NOT NULL ,
 [ACC_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [TRANS_ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [PREFIX_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [TRANS_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [WH_REFX] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TRANS_CODE)
);

CREATE TABLE IF NOT EXISTS [TRANTBM] (
 [TRANS_NO] nvarchar(50) NOT NULL ,
 [BAT_DT] nvarchar(50) NULL  DEFAULT NULL,
 [BAT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_DATE] datetime NULL ,
 [DOC_ITM] int NULL ,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_TYPE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [OFFSET_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [OFFSET_REC] bit NOT NULL ,
 [POST_BIT] bit NOT NULL ,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [STK_DT] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_AMT] decimal(19,8) NULL ,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_DDC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DOC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(19,8) NULL ,
 [TRANS_QTY2] decimal(19,8) NULL ,
 [TRANS_RMK] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TDC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_TOC] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UNIT_PRICE] decimal(19,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [BPN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [VOU_DT] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WH_FM] nvarchar(50) NULL  DEFAULT NULL,
 [WH_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [WH_TO] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(19,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TRANS_NO)
);

CREATE TABLE IF NOT EXISTS [UDTDTLM] (
 [UDT_DT] nvarchar(50) NOT NULL ,
 [UDT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [FLOW_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [REASN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_QTY] decimal(18,8) NULL ,
 [TRANS_QTY2] decimal(18,8) NULL ,
 [TRANS_RMK] ntext NULL  DEFAULT NULL,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFS01] decimal(18,0) NULL ,
 [TRANS_UDFS02] decimal(18,0) NULL ,
 [TRANS_UDFS03] decimal(18,0) NULL ,
 [TRANS_UDFS04] decimal(18,0) NULL ,
 [TRANS_UDFS05] decimal(18,0) NULL ,
 [TRANS_UDFS06] decimal(18,0) NULL ,
 [TRANS_UDFS07] decimal(18,0) NULL ,
 [TRANS_UDFS08] decimal(18,0) NULL ,
 [TRANS_UDFS09] decimal(18,0) NULL ,
 [TRANS_UDFS10] decimal(18,0) NULL ,
 [TRANS_UDFS11] decimal(18,0) NULL ,
 [UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_CODE2] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UDT_DT)
);

CREATE TABLE IF NOT EXISTS [UDTHDTM] (
 [UDT_NO] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [UDT_RMKS] ntext NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UDT_NO)
);

CREATE TABLE IF NOT EXISTS [UOMENTM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [UOM_CODE] nvarchar(8) NOT NULL ,
 [UOM_ENG] nvarchar(8) NOT NULL ,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,UOM_CODE,UOM_ENG)
);

CREATE TABLE IF NOT EXISTS [UOMMKTM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [UOM_CODE] nvarchar(8) NOT NULL ,
 [MK_UOM_CODE] nvarchar(8) NOT NULL ,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,UOM_CODE,MK_UOM_CODE)
);

CREATE TABLE IF NOT EXISTS [UOMPUTM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [UOM_CODE] nvarchar(8) NOT NULL ,
 [PU_UOM_CODE] nvarchar(8) NOT NULL ,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,UOM_CODE,PU_UOM_CODE)
);

CREATE TABLE IF NOT EXISTS [UOMSITM] (
 [UOM_CODE_FM] nvarchar(20) NOT NULL ,
 [UOM_CODE_TO] nvarchar(20) NOT NULL ,
 [UOM_XCHG] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UOM_CODE_FM,UOM_CODE_TO)
);

CREATE TABLE IF NOT EXISTS [UOMTBLM] (
 [UOM_CODE] nvarchar(8) NOT NULL ,
 [UOM_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [UOM_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UOM_CODE)
);

CREATE TABLE IF NOT EXISTS [VENITEM] (
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [VEN_CODE] nvarchar(12) NOT NULL ,
 [ITEM_ABBRE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ITEM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ITEM_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [L_PO_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_PO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [L_PO_REC_DATE] datetime NULL ,
 [L_PO_REC_QTY] decimal(18,8) NULL ,
 [L_PO_REC_WH] nvarchar(50) NULL  DEFAULT NULL,
 [L_PO_REQ_QTY] decimal(18,8) NULL ,
 [L_PO_RTV_DATE] datetime NULL ,
 [L_PO_RTV_QTY] nvarchar(10) NULL  DEFAULT NULL,
 [L_PO_UNIT_PRICE] decimal(18,8) NULL ,
 [L_PO_UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_PO_XCHG_RATE] decimal(18,8) NULL ,
 [L_VQ_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_VQ_NO] nvarchar(50) NULL  DEFAULT NULL,
 [L_VQ_REQ_DATE] datetime NULL ,
 [L_VQ_REQ_QTY] decimal(18,8) NULL ,
 [L_VQ_UNIT_PRICE] decimal(18,8) NULL ,
 [L_VQ_UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [L_VQ_XCHG_RATE] decimal(18,8) NULL ,
 [LEAD_TM] decimal(15,8) NULL ,
 [MIN_ORD] decimal(15,8) NULL ,
 [ORDL_TM] int NULL ,
 [PKG_ORD] decimal(15,8) NULL ,
 [PUR_PRICE] decimal(15,8) NULL ,
 [VEN_UNIT_PRICE] decimal(18,7) NULL ,
 [VQT_REQ_DATE] datetime NULL ,
 [VQT_REQ_QTY] decimal(15,8) NULL ,
 [VQT_UNIT_PRICE] decimal(18,0) NULL ,
 [VQT_CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VQT_DT] nvarchar(50) NULL  DEFAULT NULL,
 [STD_CCY] nvarchar(50) NULL  DEFAULT NULL,
 [STD_PRICE] decimal(15,8) NULL ,
 [T_PO_REQ_AMT] decimal(18,8) NULL ,
 [T_PO_REQ_QTY] decimal(18,8) NULL ,
 [T_PO_RTV_QTY] decimal(18,8) NULL ,
 [TDLY_DAY] decimal(15,8) NULL ,
 [TDLY_QTY] int NULL ,
 [TDLY_TIME] int NULL ,
 [TOL_PER] decimal(15,8) NULL ,
 [TORD_TIME] int NULL ,
 [TREV_AMT] decimal(15,8) NULL ,
 [TREV_QTY] decimal(15,8) NULL ,
 [TRTV_AMT] decimal(15,8) NULL ,
 [TRTV_QTY] decimal(15,8) NULL ,
 [UOM_CODE] nvarchar(6) NULL  DEFAULT NULL,
 [UOM_EXG] decimal(15,8) NULL ,
 [UOM_PUX] nvarchar(6) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [VEN_RMKS] ntext NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [VQT_NO] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (ITEM_NO,VEN_CODE)
);

CREATE TABLE IF NOT EXISTS [VENRTBM] (
 [VEN_CODE] nvarchar(20) NOT NULL ,
 [ABBR_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE07] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE08] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE09] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE10] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE11] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE12] nvarchar(50) NULL  DEFAULT NULL,
 [ALIAS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [BUYER_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CTRY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CAB] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CCY] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CONTS] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CR] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_MAIL] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_PTERM] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_VIA] nvarchar(50) NULL  DEFAULT NULL,
 [VENTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [VEN_RMKS] ntext NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [VEN_ADR05] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR06] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR07] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_ADR08] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (VEN_CODE)
);

CREATE TABLE IF NOT EXISTS [VENTPTM] (
 [VENTP_CODE] nvarchar(50) NOT NULL ,
 [VENTP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [VENTP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [VENTP_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [VENTP_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (VENTP_CODE)
);

CREATE TABLE IF NOT EXISTS [VORDTLM] (
 [VO_DT] nvarchar(50) NOT NULL ,
 [VO_NO] nvarchar(50) NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [AP_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_REF_NO] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DOC_REQ_DATE] datetime NULL ,
 [DOC_DUE_DATE] datetime NULL ,
 [PAY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_QTY] decimal(18,8) NULL ,
 [VO_DOC_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [RECT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_PERIOD] nvarchar(50) NULL  DEFAULT NULL,
 [ACC_CODE] nvarchar(50) NULL ,
 [VO_ITEM_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [VO_RMKS] ntext NULL  DEFAULT NULL,
 [AP_CCY_AMT] decimal(18,8) NULL ,
 [AP_DET_AMT] decimal(18,0) NULL ,
 [AST_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LIFE_TIME] decimal(18,8) NULL ,
 [LIFE_BAL] decimal(18,8) NULL ,
 [VO_DR_DET_AMT] decimal(18,8) NULL ,
 [VO_CR_DET_AMT] decimal(18,8) NULL ,
 [VO_DR_CCY_AMT] decimal(18,8) NULL ,
 [VO_CR_CCY_AMT] decimal(18,8) NULL ,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [SIGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE02] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE03] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE04] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE05] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ANAY_CODE06] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SERIAL_NO] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (VO_DT)
);

CREATE TABLE IF NOT EXISTS [VORHDTM] (
 [VO_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [VO_DATE] datetime NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [VO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [REVERSE_BIT] bit NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (VO_NO)
);

CREATE TABLE IF NOT EXISTS [VQTDTLM] (
 [VQT_DT] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [LEAD_TM] decimal(18,8) NULL ,
 [MIN_ORD] decimal(18,8) NULL ,
 [PKG_ORD] decimal(18,8) NULL ,
 [PRIM_VQT] bit NULL ,
 [VQT_REQ_DATE] datetime NULL ,
 [VQT_REQ_QTY] decimal(18,8) NULL ,
 [VQT_QTY] decimal(18,8) NULL ,
 [UOM_VQT] nvarchar(50) NULL  DEFAULT NULL,
 [UOM_XCHG] decimal(18,8) NULL ,
 [VQT_UNIT_PRICE] decimal(18,8) NULL ,
 [UOM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UPDATE_VEN_ITEM] bit NULL ,
 [VEN_ITEM_NO] nvarchar(50) NULL  DEFAULT NULL,
 [VQT_NO] nvarchar(50) NULL  DEFAULT NULL,
 [VQT_DT_RMKS] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [VEN_ITEM_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (VQT_DT)
);

CREATE TABLE IF NOT EXISTS [VQTHDTM] (
 [VQT_NO] nvarchar(50) NOT NULL ,
 [BUYER_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [EXPIRY_DATE] datetime NULL ,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VQT_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [PTERM_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VQT_REQ_DATE] datetime NULL ,
 [SVIA_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VEN_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [VEN_TERM] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (VQT_NO)
);

CREATE TABLE IF NOT EXISTS [WHCDTBM] (
 [WH_CODE] nvarchar(50) NOT NULL ,
 [ACC_CODE01] nvarchar(50) NULL  DEFAULT NULL,
 [DELY_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [FREEZE_BIT] bit NULL ,
 [NET_ABLE] bit NOT NULL ,
 [REGN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [STK_TAG] decimal(15,8) NULL ,
 [WH_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [WH_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [WH_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [WH_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [WH_COST] bit NULL ,
 [WH_DUMY] bit NOT NULL ,
 [WH_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [WH_GROUP] nvarchar(50) NULL  DEFAULT NULL,
 [WH_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [WH_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [WH_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [WH_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [WH_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CLASS] nvarchar(50) NULL  DEFAULT NULL,
 [WH_UDFX01] nvarchar(20) NULL  DEFAULT NULL,
 [WH_UDFX02] nvarchar(20) NULL  DEFAULT NULL,
 [WH_UDFX03] nvarchar(20) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (WH_CODE)
);

CREATE TABLE IF NOT EXISTS [WHLOCTM] (
 [LOC_CODE] nvarchar(20) NOT NULL ,
 [WH_CODE] nvarchar(20) NOT NULL ,
 [WHLOC_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [WHLOC_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [WHLOC_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [WHLOC_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LOC_CODE,WH_CODE)
);

CREATE TABLE IF NOT EXISTS [WMIDTLM] (
 [WI_DT] nvarchar(50) NOT NULL ,
 [CCY_CODE] nvarchar(3) NOT NULL ,
 [DOC_NO] nvarchar(50) NOT NULL ,
 [FLOW_CODE] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(22) NOT NULL ,
 [WI_NO] nvarchar(50) NOT NULL ,
 [REFX_NO] nvarchar(50) NOT NULL ,
 [TRANS_QTY] decimal(18,8) NOT NULL ,
 [TRANS_QTY2] decimal(18,8) NOT NULL ,
 [TRANS_RMK] ntext NOT NULL ,
 [TRANS_UDF11] nvarchar(50) NOT NULL ,
 [TRANS_UDF12] nvarchar(50) NOT NULL ,
 [TRANS_UDF13] nvarchar(50) NOT NULL ,
 [TRANS_UDF14] nvarchar(50) NOT NULL ,
 [TRANS_UDF15] nvarchar(50) NOT NULL ,
 [TRANS_UDF16] nvarchar(50) NOT NULL ,
 [TRANS_UDF17] nvarchar(50) NOT NULL ,
 [TRANS_UDF18] nvarchar(50) NOT NULL ,
 [TRANS_UDF19] nvarchar(50) NOT NULL ,
 [TRANS_UDF20] nvarchar(50) NOT NULL ,
 [TRANS_UDFX1] nvarchar(50) NOT NULL ,
 [TRANS_UDFX2] nvarchar(50) NOT NULL ,
 [TRANS_UDFX3] nvarchar(50) NOT NULL ,
 [TRANS_UDFX4] nvarchar(50) NOT NULL ,
 [TRANS_UDFX5] nvarchar(50) NOT NULL ,
 [TRANS_UDFX6] nvarchar(50) NOT NULL ,
 [UNIT_PRICE] decimal(18,8) NOT NULL ,
 [UOM_CODE] nvarchar(6) NOT NULL ,
 [UOM_CODE2] nvarchar(50) NOT NULL ,
 [XCHG_RATE] decimal(18,8) NOT NULL ,
 [ZADD_DATE] datetime NOT NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NOT NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NOT NULL ,
 [ZSECURITY_CODE4] nvarchar(12) NOT NULL ,
 [ZSECURITY_CODE5] nvarchar(12) NOT NULL ,
 [ZSECURITY_CODE6] nvarchar(12) NOT NULL ,
 [ZSECURITY_RIGHT] int NOT NULL ,
 [SERIAL_NO] int NOT NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (WI_DT)
);

CREATE TABLE IF NOT EXISTS [WMIHDTM] (
 [WI_NO] nvarchar(20) NOT NULL ,
 [CCY_CODE] nvarchar(3) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [REFX_NO] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_DATE] datetime NULL ,
 [TRANS_UDF11] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF12] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF13] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF14] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF15] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF16] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF17] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF18] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF19] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDF20] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [XCHG_RATE] decimal(15,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (WI_NO)
);

CREATE TABLE IF NOT EXISTS [WORDTLM] (
 [WO_DT] nvarchar(50) NOT NULL ,
 [HAND_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WO_MI_AMT] decimal(18,8) NULL ,
 [WO_MI_QTY] decimal(18,8) NULL ,
 [ITEM_NO] nvarchar(20) NULL  DEFAULT NULL,
 [WO_REQ_DATE] datetime NULL ,
 [WO_REQ_QTY] decimal(18,8) NULL ,
 [WO_RTN_AMT] decimal(18,8) NULL ,
 [WO_RTN_QTY] decimal(18,8) NULL ,
 [WO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [WO_DT_RMKS] ntext NULL  DEFAULT NULL,
 [WO_FG_AMT] decimal(18,8) NULL ,
 [WO_FG_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (WO_DT)
);

CREATE TABLE IF NOT EXISTS [WORHDTM] (
 [WO_NO] nvarchar(50) NOT NULL ,
 [COMP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [CTR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [MO_DT] nvarchar(50) NULL  DEFAULT NULL,
 [MO_NO] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WO_ODTP_RMKS] ntext NULL  DEFAULT NULL,
 [ODTP_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_XREV] int NULL ,
 [ASSM_REQ_DATE] datetime NULL ,
 [ASSM_REQ_QTY] decimal(18,8) NULL ,
 [ASSM_FG_AMT] decimal(18,8) NULL ,
 [ASSM_FG_QTY] decimal(18,8) NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ITEM_REQ_DATE] datetime NULL ,
 [BPN_CODE] nvarchar(50) NULL  DEFAULT NULL,
 PRIMARY KEY (WO_NO)
);

CREATE TABLE IF NOT EXISTS [ZNAGENTM] (
 [AUTHORIZED_AGENT] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [ACTIVE_FM] datetime NULL ,
 [ACTIVE_TO] datetime NULL ,
 [LOGON_MD5] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (AUTHORIZED_AGENT,LOGON_ID)
);

CREATE TABLE IF NOT EXISTS [ZNAPVCDM] (
 [APPV_CODE] nvarchar(50) NOT NULL ,
 [APPV_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [APPV_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [APPV_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [APPV_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (APPV_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCDFTBM] (
 [UID_CODE] nvarchar(20) NOT NULL ,
 [CDF_CLASS_CODE] nvarchar(20) NOT NULL ,
 [CDF_CODE] nvarchar(40) NOT NULL ,
 [CDF_DEFAULT] nvarchar(40) NULL  DEFAULT NULL,
 [CDF_LENGTH] int NULL ,
 [CDF_USAGE] bit NULL  DEFAULT NULL,
 [CDF_TP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [COLUMN_NULLABLE] bit NULL  DEFAULT NULL,
 [COLUMN_SCALE] int NULL ,
 [ORDINAL] int NULL ,
 [LABEL_ID] nvarchar(50) NULL  DEFAULT NULL,
 [CDF_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CDF_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CDF_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [CDF_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEU_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEA_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEB_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEC_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UID_CODE,CDF_CLASS_CODE,CDF_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCFGTBM] (
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [VART_CODE] nvarchar(20) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [VART_VALUE] nvarchar(50) NULL  DEFAULT NULL,
 [VART_TP_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [VART_CLASS_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [VART_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ROLE_CODE,LOGON_ID,VART_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCLIPBM] (
 [CLIP_CODE] nvarchar(18) NOT NULL ,
 [CLIP_CLASS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CLIP_CONT] ntext NULL  DEFAULT NULL,
 [CLIP_FORMAT] nvarchar(50) NULL  DEFAULT NULL,
 [CLIP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CLIP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CLIP_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCOMDTM] (
 [COMBO_CODE] nvarchar(20) NOT NULL ,
 [COMBO_VALUE] nvarchar(50) NOT NULL ,
 [COMBO_NAME1] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME2] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME3] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME4] nvarchar(50) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COMBO_CODE,COMBO_VALUE)
);

CREATE TABLE IF NOT EXISTS [ZNCOMHDM] (
 [COMBO_CODE] nvarchar(20) NOT NULL ,
 [COMBO_NAME1] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME2] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME3] nvarchar(50) NULL  DEFAULT NULL,
 [COMBO_NAME4] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COMBO_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCOMPTM] (
 [COMP_CODE] nvarchar(8) NOT NULL ,
 [ABBR_NAME] nvarchar(12) NULL  DEFAULT NULL,
 [ACC_CODE01] nvarchar(10) NULL  DEFAULT NULL,
 [COMP_ADR01] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR02] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR03] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR04] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR05] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR06] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR07] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_ADR08] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CBL] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CONT] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_FAX] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [WH_UDFX01] nvarchar(20) NULL  DEFAULT NULL,
 [WH_UDFX02] nvarchar(20) NULL  DEFAULT NULL,
 [WH_UDFX03] nvarchar(20) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COMP_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNCONDTM] (
 [CONDI_NO] nvarchar(50) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ROLE_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [USQL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [CONDT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [CONDT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [CONDT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [CONDT_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ORDER_CLAUSE] ntext NULL  DEFAULT NULL,
 [WHERE_CLAUSE] ntext NULL  DEFAULT NULL,
 [DEFAULT_BIT] bit NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (CONDI_NO)
);

CREATE TABLE IF NOT EXISTS [ZNCSSTBM] (
 [THEME_CODE] nvarchar(50) NOT NULL ,
 [CLASS_NAME] nvarchar(50) NOT NULL ,
 [Attribute_NAME] nvarchar(50) NOT NULL ,
 [Attribute_DATA] nvarchar(100) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (THEME_CODE,CLASS_NAME,Attribute_NAME)
);

CREATE TABLE IF NOT EXISTS [ZNDEPTBM] (
 [DEPT_CODE] nvarchar(50) NOT NULL ,
 [DEPT_DIR] nvarchar(20) NULL  DEFAULT NULL,
 [DEPT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_RMKS] ntext NULL  DEFAULT NULL,
 [DEPT_TEL] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (DEPT_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNDESKTM] (
 [DESK_DT] nvarchar(50) NOT NULL ,
 [ROLE_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL ,
 [LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [VURL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ICON_X] int NULL ,
 [ICON_Y] int NULL ,
 [ICON_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [AUTO_BIT] bit NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (DESK_DT)
);

CREATE TABLE IF NOT EXISTS [ZNDOCKTM] (
 [DOCK_DT] nvarchar(50) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [DOCK_CODE] nvarchar(200) NULL  DEFAULT NULL,
 [ICON_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [DOCK_OUT] nvarchar(50) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (DOCK_DT)
);

CREATE TABLE IF NOT EXISTS [ZNIPADRM] (
 [ADDRESS_DT] nvarchar(18) NOT NULL ,
 [UID_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ROLE_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [ACCESS_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ACCESS_DATE_FM] datetime NULL ,
 [ACCESS_DATE_TO] datetime NULL ,
 [ACCESS_TIME_FM] nvarchar(20) NULL  DEFAULT NULL,
 [ACCESS_TIME_TO] nvarchar(20) NULL  DEFAULT NULL,
 [IP_ADDRESS] nvarchar(30) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ADDRESS_DT)
);

CREATE TABLE IF NOT EXISTS [ZNLANGFX] (
 [LANG_CHT] nvarchar(50) NOT NULL ,
 [LANG_FX] nvarchar(50) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (LANG_CHT)
);

CREATE TABLE IF NOT EXISTS [ZNLOGTBM] (
 [AUTO_RECN] int NOT NULL ,
 [ATVT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ATVT_ADDR] nvarchar(50) NULL  DEFAULT NULL,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ATVT_DATA] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (AUTO_RECN)
);

CREATE TABLE IF NOT EXISTS [ZNOPTDTM] (
 [UID_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [COLUMN_NAME] nvarchar(50) NOT NULL ,
 [OPT_VALUE] nvarchar(50) NOT NULL ,
 [LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COLUMN_NAME,OPT_VALUE)
);

CREATE TABLE IF NOT EXISTS [ZNOPTHDM] (
 [UID_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [COLUMN_NAME] nvarchar(50) NOT NULL ,
 [OPT_DEFAULT] nvarchar(50) NULL  DEFAULT NULL,
 [OPT_NAME1] nvarchar(50) NULL  DEFAULT NULL,
 [OPT_NAME2] nvarchar(50) NULL  DEFAULT NULL,
 [OPT_NAME3] nvarchar(50) NULL  DEFAULT NULL,
 [OPT_NAME4] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COLUMN_NAME)
);

CREATE TABLE IF NOT EXISTS [ZNREQTBM] (
 [REQ_CODE] nvarchar(50) NOT NULL ,
 [OPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_RMKS] ntext NULL  DEFAULT NULL,
 [REQ_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [START_BIT] bit NULL  DEFAULT NULL,
 [REQ_USER] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_URL] nvarchar(50) NULL  DEFAULT NULL,
 [REQ_OPT] ntext NULL  DEFAULT NULL,
 [TASK_REQ_DATE] datetime NULL ,
 [TASK_REQ_TIME] nvarchar(15) NULL  DEFAULT NULL,
 [TASK_RUN_DATE] datetime NULL ,
 [TASK_RUN_TIME] nvarchar(15) NULL  DEFAULT NULL,
 [START_DATE] datetime NULL ,
 [START_TIME] nvarchar(15) NULL  DEFAULT NULL,
 [START_CLASS] nvarchar(10) NULL  DEFAULT NULL,
 [START_OPT01] bit NULL  DEFAULT NULL,
 [START_OPT02] bit NULL  DEFAULT NULL,
 [START_OPT03] bit NULL  DEFAULT NULL,
 [START_OPT04] bit NULL  DEFAULT NULL,
 [START_OPT05] bit NULL  DEFAULT NULL,
 [START_OPT06] bit NULL  DEFAULT NULL,
 [START_OPT07] bit NULL  DEFAULT NULL,
 [START_OPT08] bit NULL  DEFAULT NULL,
 [START_OPT09] bit NULL  DEFAULT NULL,
 [START_OPT10] bit NULL  DEFAULT NULL,
 [START_OPT11] bit NULL  DEFAULT NULL,
 [START_OPT12] bit NULL  DEFAULT NULL,
 [START_OPT13] int NULL ,
 [START_OPT14] int NULL ,
 [START_OPT15] ntext NULL  DEFAULT NULL,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [TASK_CLASS] nvarchar(2) NULL  DEFAULT NULL,
 [TASK_FM] datetime NULL ,
 [TASK_INT] int NULL ,
 [TASK_NEXT] nvarchar(50) NULL  DEFAULT NULL,
 [TASK_OPT] nvarchar(50) NULL  DEFAULT NULL,
 [TASK_TIME] nvarchar(50) NULL  DEFAULT NULL,
 [TASK_TO] datetime NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REQ_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNRIGHTM] (
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [ACCESS_ATTRIBUTE] int NULL ,
 [ALLOW_ACCESS] bit NULL ,
 [ALLOW_ADDNEW] bit NOT NULL ,
 [ALLOW_UPDATE] bit NOT NULL ,
 [ALLOW_DELETE] bit NOT NULL ,
 [ALLOW_OTHER] bit NOT NULL ,
 [ALLOW_POSTE] bit NOT NULL ,
 [ALLOW_PRINT] bit NOT NULL ,
 [ALLOW_RATIFY] bit NOT NULL ,
 [ACCESS_RT_CODE01] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE02] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE03] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE04] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE05] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE06] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE07] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE08] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE09] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE10] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE11] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE12] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE13] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE14] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE15] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE16] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE17] nvarchar(10) NULL  DEFAULT NULL,
 [ACCESS_RT_CODE18] nvarchar(10) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ROLE_CODE,LOGON_ID,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNROLETM] (
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [ROLE_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [ROLE_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [ROLE_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [ROLE_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ROLE_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNRTCDTM] (
 [ACCESS_RT_CODE] nvarchar(50) NOT NULL ,
 [ACCESS_RT_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ACCESS_RT_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ACCESS_RT_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [ACCESS_RT_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (ACCESS_RT_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNSIGNTM] (
 [SIGN_CODE] nvarchar(32) NOT NULL ,
 [SIGN_DATE] datetime NOT NULL ,
 [SIGN_DATA] ntext NULL  DEFAULT NULL,
 [SIGN_STATUS] nvarchar(12) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SIGN_ODTP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 PRIMARY KEY (SIGN_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNSMSTBM] (
 [SMS_ID] nvarchar(50) NOT NULL ,
 [SMS_SENDER] nvarchar(50) NULL  DEFAULT NULL,
 [SMS_INCEPT] nvarchar(50) NULL  DEFAULT NULL,
 [SMS_TITLE] nvarchar(50) NULL  DEFAULT NULL,
 [SMS_CONTENT] ntext NULL  DEFAULT NULL,
 [READ_BIT] bit NULL  DEFAULT NULL,
 [SENT_BIT] bit NULL  DEFAULT NULL,
 [DELF_BIT] bit NULL  DEFAULT NULL,
 [DELT_BIT] bit NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (SMS_ID)
);

CREATE TABLE IF NOT EXISTS [ZNSNSTKM] (
 [STK_DT] nvarchar(50) NOT NULL ,
 [ITEM_NO] nvarchar(22) NULL  DEFAULT NULL,
 [TRANS_UDFX1] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX2] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX3] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX4] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX5] nvarchar(50) NULL  DEFAULT NULL,
 [TRANS_UDFX6] nvarchar(50) NULL  DEFAULT NULL,
 [WH_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [SERIAL_NO] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (STK_DT)
);

CREATE TABLE IF NOT EXISTS [ZNSSDTBM] (
 [LOGON_SSD] nvarchar(40) NOT NULL ,
 [LOGON_DB] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [LOGON_IP] nvarchar(20) NULL  DEFAULT NULL,
 [LOGON_LANG] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_SVR] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_PIXELS] nvarchar(15) NULL  DEFAULT NULL,
 [LOGON_DATE_FMT] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_DATE_SEP] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_AGENT_MD5] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_TICK] datetime NULL ,
 [LOGON_TICKS] int NULL ,
 [LOGON_IDLE] datetime NULL ,
 [LOGON_IDLES] int NULL ,
 [LOGON_UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [LOGON_SCALE] nvarchar(4) NULL  DEFAULT NULL,
 PRIMARY KEY (LOGON_SSD)
);

CREATE TABLE IF NOT EXISTS [ZNTABLEM] (
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [TABLE_NAME] nvarchar(50) NOT NULL ,
 [ACCESS_CODE1] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_CODE2] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_CODE3] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_CODE4] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_CODE5] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_CODE6] nvarchar(32) NULL  DEFAULT NULL,
 [ACCESS_FM] int NULL ,
 [ACCESS_TO] int NULL ,
 [DATA_ACCESS] bit NOT NULL ,
 [SECURITY_CODE1] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_CODE2] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_CODE3] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_CODE4] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_CODE5] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_CODE6] nvarchar(8) NULL  DEFAULT NULL,
 [SECURITY_RIGHT] int NULL ,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [UPDATE_CODE1] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_CODE2] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_CODE3] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_CODE4] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_CODE5] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_CODE6] nvarchar(32) NULL  DEFAULT NULL,
 [UPDATE_FM] int NULL ,
 [UPDATE_TO] int NULL ,
 [DELETE_CODE1] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_CODE2] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_CODE3] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_CODE4] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_CODE5] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_CODE6] nvarchar(32) NULL  DEFAULT NULL,
 [DELETE_FM] int NULL ,
 [DELETE_TO] int NULL ,
 [WHERE_CLAUSE] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ROLE_CODE,LOGON_ID,TABLE_NAME)
);

CREATE TABLE IF NOT EXISTS [ZNTHEMEM] (
 [THEME_CODE] nvarchar(50) NOT NULL ,
 [UID_CODE] nvarchar(50) NOT NULL ,
 [TABLE_NAME] nvarchar(50) NOT NULL ,
 [COLUMN_NAME] nvarchar(50) NOT NULL ,
 [COLUMN_COLS] int NULL ,
 [COLUMN_ROWS] int NULL ,
 [COLUMN_NROW] bit NULL  DEFAULT NULL,
 [COLUMN_H] int NULL ,
 [COLUMN_W] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ORDINAL] int NULL ,
 PRIMARY KEY (THEME_CODE,UID_CODE,TABLE_NAME,COLUMN_NAME)
);

CREATE TABLE IF NOT EXISTS [ZNTODOTM] (
 [TODO_CODE] nvarchar(50) NOT NULL ,
 [DUE_DATE] datetime NULL ,
 [FINAL_DATE] datetime NULL ,
 [PRIT_CODE] nvarchar(5) NULL  DEFAULT NULL,
 [START_DATE] datetime NULL ,
 [TODO_TAG] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_WORD] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_CLASS] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [TODO_RMKS] ntext NULL  DEFAULT NULL,
 [TODO_STATUS] nvarchar(8) NULL  DEFAULT NULL,
 [TRGT_FINAL] datetime NULL ,
 [TRGT_START] datetime NULL ,
 [LOGON_ID] nvarchar(12) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TODO_CODE)
);

CREATE TABLE IF NOT EXISTS [ZNUSERTM] (
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [ACCESS_CODE1] nvarchar(8) NULL  DEFAULT NULL,
 [ACCESS_CODE2] nvarchar(8) NULL  DEFAULT NULL,
 [ACCESS_CODE3] nvarchar(8) NULL  DEFAULT NULL,
 [ACCESS_CODE4] nvarchar(8) NULL  DEFAULT NULL,
 [ACCESS_CODE5] nvarchar(8) NULL  DEFAULT NULL,
 [ACCESS_CODE6] nvarchar(8) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL ,
 [ACTIVE_FM] datetime NULL ,
 [ACTIVE_TO] datetime NULL ,
 [ALIAS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DEPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [EMAIL_ADDR] nvarchar(50) NULL  DEFAULT NULL,
 [LICGP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LOGON_LANG] nvarchar(50) NULL  DEFAULT NULL,
 [PASS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ROLE_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [USER_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [USER_DATE_FMT] nvarchar(20) NULL  DEFAULT NULL,
 [USER_DATE_SEP] nvarchar(2) NULL  DEFAULT NULL,
 [LOGON_MD5] nvarchar(50) NULL  DEFAULT NULL,
 [USER_FONT_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [USER_FONT_SIZE] int NULL ,
 [WRONG_DATE] datetime NULL ,
 [WRONG_TIMES] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LOGON_ID)
);

CREATE TABLE IF NOT EXISTS [ZNUSRAPM] (
 [APPV_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (APPV_CODE,LOGON_ID)
);

CREATE TABLE IF NOT EXISTS [ZNUSRDFM] (
 [UID_CODE] nvarchar(50) NOT NULL ,
 [USRDF_CODE] nvarchar(50) NOT NULL ,
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [HIDDEN_BIT] bit NULL ,
 [USRDF_REFX] nvarchar(50) NULL  DEFAULT NULL,
 [USRDF_DATA] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEU_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEA_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEB_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEC_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [USRDF_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [USRDF_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UID_CODE,USRDF_CODE,ROLE_CODE,LOGON_ID)
);

CREATE TABLE IF NOT EXISTS [ZNVARTBM] (
 [ROLE_CODE] nvarchar(12) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [VART_CODE] nvarchar(20) NOT NULL ,
 [VART_VALUE] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME03] nvarchar(50) NULL  DEFAULT NULL,
 [VART_NAME04] nvarchar(50) NULL  DEFAULT NULL,
 [VART_TP_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ROLE_CODE,LOGON_ID,VART_CODE)
);

CREATE TABLE IF NOT EXISTS [ZTCLASSM] (
 [COLUMN_CLASS_CODE] nvarchar(40) NOT NULL ,
 [COLUMN_LENGTH] int NULL ,
 [COLUMN_SCALE] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (COLUMN_CLASS_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUATVTBM] (
 [STATUS_CODE] nvarchar(18) NOT NULL ,
 [BTN_ATVT_CODE] nvarchar(18) NOT NULL ,
 [DEFINED_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [FUNCTION_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SIGN_ATVT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (STATUS_CODE,BTN_ATVT_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUBTNSTM] (
 [XBAR_CODE] nvarchar(18) NOT NULL ,
 [VIEW_STAGEU_CODE] nvarchar(18) NOT NULL ,
 [BUTTON_ID] nvarchar(18) NOT NULL ,
 [BTN_ATVT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [STATUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [DATA_STATUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_STATUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [BTN_CLASS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [BTN_HK_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [BTN_LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [TITLE_ID] nvarchar(50) NULL  DEFAULT NULL,
 [BTN_MSG_ID] nvarchar(50) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [STATUS_CODE_T] nvarchar(50) NULL  DEFAULT NULL,
 [STAGEU_CODE_T] nvarchar(50) NULL  DEFAULT NULL,
 [XEVENT_CODE] nvarchar(200) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [BTN_IMG_ID] nvarchar(20) NULL  DEFAULT NULL,
 PRIMARY KEY (XBAR_CODE,VIEW_STAGEU_CODE,BUTTON_ID)
);

CREATE TABLE IF NOT EXISTS [ZUCACHEM] (
 [LOGON_CACHE] nvarchar(50) NOT NULL ,
 [LOGON_NDX] int NOT NULL ,
 [LOGON_SSD] nvarchar(36) NULL  DEFAULT NULL,
 [LOGON_CONTEXT] ntext NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [LOGON_TP_CODE] nvarchar(2) NULL  DEFAULT NULL,
 PRIMARY KEY (LOGON_CACHE,LOGON_NDX)
);

CREATE TABLE IF NOT EXISTS [ZUCOLUTM] (
 [TABLE_NAME] nvarchar(20) NOT NULL ,
 [COLUMN_NAME] nvarchar(50) NOT NULL ,
 [AUTO_INCREMENT] bit NOT NULL ,
 [COLUMN_NULLABLE] bit NOT NULL ,
 [COLUMN_CLASS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_DEFAULT] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_LENGTH] int NULL ,
 [COLUMN_USAGE] bit NOT NULL ,
 [COLUMN_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_PK_BIT] bit NOT NULL ,
 [COLUMN_SCALE] int NULL ,
 [LABEL_ID] nvarchar(50) NULL  DEFAULT NULL,
 [VERFY_BIT] bit NOT NULL ,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TABLE_NAME,COLUMN_NAME)
);

CREATE TABLE IF NOT EXISTS [ZUDATCDM] (
 [TABLE_NAME] nvarchar(20) NOT NULL ,
 [TABLE_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [TABLE_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [TABLE_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [TABLE_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TABLE_NAME)
);

CREATE TABLE IF NOT EXISTS [ZULABELM] (
 [LABEL_ID] nvarchar(50) NOT NULL ,
 [LANG_CODE] nvarchar(8) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [LANG_NAME] nvarchar(200) NULL  DEFAULT NULL,
 [LOCK_BIT] bit NOT NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LABEL_ID,LANG_CODE,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZULNKTBM] (
 [LNK_UID_CODE] nvarchar(20) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [TABLE_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [COLUMN_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [LNK_TABLE_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [LNK_COLUMN_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [LNK_TP_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LNK_UID_CODE,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUMUTBLM] (
 [LNK_UID_CODE] nvarchar(20) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [ICON_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [COLUMN_NUM] int NULL ,
 [VOPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VURL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LNK_UID_CODE,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUODTPTM] (
 [ODTP_CODE] nvarchar(15) NOT NULL ,
 [ODTP_CLASS_CODE] nvarchar(15) NULL  DEFAULT NULL,
 [ODTP_SYSTEM] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [ODTP_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PREFIX_CODE] nvarchar(40) NULL  DEFAULT NULL,
 [COMP_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [XDIR_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (ODTP_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUPANELM] (
 [LNK_UID_CODE] nvarchar(20) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [LABEL_ID] nvarchar(30) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [STATUS_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (LNK_UID_CODE,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUPKGTBM] (
 [PKG_CODE] nvarchar(20) NOT NULL ,
 [UID_CODE] nvarchar(20) NOT NULL ,
 [MODULE_CODE] nvarchar(32) NULL  DEFAULT NULL,
 [PKG_TP_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL  DEFAULT NULL,
 [UID_MD5_CODE] nvarchar(32) NULL  DEFAULT NULL,
 [UID_VER_CODE] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PKG_CODE,UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUPMRTBM] (
 [PMR_NO] nvarchar(50) NOT NULL ,
 [UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [PMR_DATE] datetime NULL ,
 [PMR_RMKS] ntext NULL  DEFAULT NULL,
 [PMR_CONT] ntext NULL  DEFAULT NULL,
 [PMR_USER] nvarchar(50) NULL  DEFAULT NULL,
 [PMR_CFM] nvarchar(50) NULL  DEFAULT NULL,
 [PMR_STATUS] nvarchar(50) NULL  DEFAULT NULL,
 [PMR_TAG] nvarchar(50) NULL  DEFAULT NULL,
 [PMR_TITLE] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (PMR_NO)
);

CREATE TABLE IF NOT EXISTS [ZUPREFXM] (
 [PREFIX_CODE] nvarchar(40) NOT NULL ,
 [PREFIX_NAME01] nvarchar(50) NULL  DEFAULT NULL,
 [PREFIX_NAME02] nvarchar(50) NULL  DEFAULT NULL,
 [PREFIX_DATA] nvarchar(30) NULL  DEFAULT NULL,
 [PREFIX_CN] int NULL ,
 [PREFIX_CLASS_CODE] nvarchar(12) NULL  DEFAULT NULL,
 [PREFIX_TP_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [TOTAL_WIDTH] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (PREFIX_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUPRGDTM] (
 [UID_CODE] nvarchar(20) NOT NULL ,
 [DTL_NDX] int NOT NULL ,
 [ACTIVE_BIT] bit NOT NULL ,
 [COLUMN_NULLABLE] bit NOT NULL ,
 [STAGEU_STATUS] nvarchar(20) NULL  DEFAULT NULL,
 [BASE_TABLE_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [BASE_COLUMN_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [TABLE_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_HEIGHT] int NULL ,
 [COLUMN_WIDTH] int NULL ,
 [COLUMN_CLASS_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [COLUMN_TP_CODE] nvarchar(10) NULL  DEFAULT NULL,
 [COLUMN_CAT_CODE] nvarchar(50) NULL ,
 [COLS_SPAN] int NULL ,
 [ROWS_SPAN] int NULL ,
 [INIT_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [LABEL_ID] nvarchar(50) NULL  DEFAULT NULL,
 [LINE_REVEAL] bit NOT NULL ,
 [LNK_COLUMN_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [NEW_CELL] bit NOT NULL ,
 [NEW_LINE] bit NOT NULL ,
 [OPT_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [REA_UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [RELY_DEFAULT] nvarchar(50) NULL  DEFAULT NULL,
 [DATA_VIEWER] nvarchar(50) NULL  DEFAULT NULL,
 [RELY_VERFY] nvarchar(50) NULL  DEFAULT NULL,
 [RELY_VIEW] nvarchar(50) NULL  DEFAULT NULL,
 [UPDATE_BIT] bit NOT NULL ,
 [USQL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [VERFY_BIT] bit NOT NULL ,
 [XLNK_COLUMN] bit NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [UID_DT] nvarchar(18) NOT NULL ,
 [SERIAL_NO] int NULL ,
 PRIMARY KEY (UID_DT)
);

CREATE TABLE IF NOT EXISTS [ZUPRGHDM] (
 [UID_CODE] nvarchar(20) NOT NULL ,
 [ABBR_NAME] nvarchar(20) NULL  DEFAULT NULL,
 [ACTIVE_BIT] bit NULL  DEFAULT NULL,
 [LNK_UID_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [PK_TP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [PK_COLUMN_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [UID_TP_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [TABLE_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [UGET_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [RFX_UID_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [USQL_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [USQL_CODE_D] nvarchar(50) NULL  DEFAULT NULL,
 [UID_MD5_CODE] nvarchar(32) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UID_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUREFDTM] (
 [REFX_CODE] nvarchar(20) NOT NULL ,
 [TABLE_NAME] nvarchar(50) NOT NULL ,
 [COLUMN_NAME] nvarchar(50) NOT NULL ,
 [ACCESS_TABLE_NAME] nvarchar(50) NOT NULL ,
 [ACCESS_COLUMN_NAME] nvarchar(50) NOT NULL ,
 [ACCESS_FORMULA] nvarchar(200) NULL  DEFAULT NULL,
 [ACCESS_TP_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [ACCESS_WHERE_DATA] nvarchar(50) NULL  DEFAULT NULL,
 [FORCE_BIT] bit NULL ,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REFX_CODE,TABLE_NAME,COLUMN_NAME,ACCESS_TABLE_NAME,ACCESS_COLUMN_NAME)
);

CREATE TABLE IF NOT EXISTS [ZUREFHDM] (
 [REFX_CODE] nvarchar(20) NOT NULL ,
 [TABLE_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [USQL_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [WHERE_CLAUSE] ntext NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (REFX_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUSQLDTM] (
 [USQL_CODE] nvarchar(20) NOT NULL ,
 [DTL_NDX] nvarchar(10) NOT NULL ,
 [LOGON_ID] nvarchar(12) NOT NULL ,
 [ACTIVE_BIT] bit NULL ,
 [TABLE_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [ALIAS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [USQL_FORMULA] nvarchar(100) NULL  DEFAULT NULL,
 [UGET_CODE] nvarchar(20) NULL  DEFAULT NULL,
 [LABEL_ID] nvarchar(50) NULL  DEFAULT NULL,
 [ORDINAL] int NULL ,
 [USQL_TAG01] nvarchar(50) NULL  DEFAULT NULL,
 [USQL_TAG02] nvarchar(50) NULL  DEFAULT NULL,
 [COLUMN_TP_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [SUGGT_BIT] bit NULL  DEFAULT NULL,
 [STATUS_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LNK_UID_CODE] nvarchar(50) NULL  DEFAULT NULL,
 [LNK_USQL_DATA] nvarchar(50) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (USQL_CODE,DTL_NDX,LOGON_ID)
);

CREATE TABLE IF NOT EXISTS [ZUSQLHDM] (
 [USQL_CODE] nvarchar(20) NOT NULL ,
 [DISTINCT_BIT] bit NULL ,
 [FROM_CLAUSE] ntext NULL  DEFAULT NULL,
 [ORDER_CLAUSE] ntext NULL  DEFAULT NULL,
 [GROUP_CLAUSE] ntext NULL  DEFAULT NULL,
 [WHERE_CLAUSE] ntext NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (USQL_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUSTATBM] (
 [STATUS_MODE] nvarchar(50) NOT NULL ,
 [STATUS_FUNS_CODE] nvarchar(50) NOT NULL ,
 [STATUS_CODE_FM] nvarchar(50) NOT NULL ,
 [STATUS_CODE_TO] nvarchar(20) NULL  DEFAULT NULL,
 [STATUS_ACCEPT_BIT] bit NULL  DEFAULT NULL,
 [STATUS_RMKS] nvarchar(50) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (STATUS_MODE,STATUS_FUNS_CODE,STATUS_CODE_FM)
);

CREATE TABLE IF NOT EXISTS [ZUSTATEM] (
 [LANG_CODE] nvarchar(25) NOT NULL ,
 [STATE_CODE] nvarchar(50) NOT NULL ,
 [STATE_NAME] nvarchar(100) NULL  DEFAULT NULL,
 [STATE_XREF] nvarchar(100) NULL  DEFAULT NULL,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 PRIMARY KEY (LANG_CODE,STATE_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUSTATUM] (
 [STATUS_MODE] nvarchar(50) NOT NULL ,
 [STATUS_CODE] nvarchar(20) NOT NULL ,
 [STATUS_ATVT] nvarchar(50) NOT NULL ,
 [STATUS_NAME] nvarchar(50) NULL  DEFAULT NULL,
 [STATUS_CAPTION] nvarchar(50) NULL  DEFAULT NULL,
 [STATUS_ACCEPT_BIT] bit NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (STATUS_MODE,STATUS_CODE,STATUS_ATVT)
);

CREATE TABLE IF NOT EXISTS [ZUTRNTPM] (
 [TRANS_TP_CODE] nvarchar(8) NOT NULL ,
 [TRANS_CLASS_CODE] nvarchar(40) NULL  DEFAULT NULL,
 [TRANS_TP_NAME01] nvarchar(40) NULL  DEFAULT NULL,
 [TRANS_TP_NAME02] nvarchar(40) NULL  DEFAULT NULL,
 [TRANS_TP_NAME03] nvarchar(40) NULL  DEFAULT NULL,
 [TRANS_TP_NAME04] nvarchar(40) NULL  DEFAULT NULL,
 [SIGN_CODE] nvarchar(8) NULL  DEFAULT NULL,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (TRANS_TP_CODE)
);

CREATE TABLE IF NOT EXISTS [ZUUGETBM] (
 [UGET_CODE] nvarchar(50) NOT NULL ,
 [REFX_CODE] nvarchar(50) NOT NULL ,
 [ORDINAL] int NULL ,
 [ZSECURITY_CODE1] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE2] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE3] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE4] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE5] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_CODE6] nvarchar(12) NULL  DEFAULT NULL,
 [ZSECURITY_RIGHT] int NULL ,
 [ZADD_DATE] datetime NULL ,
 [ZADD_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_DATE] datetime NULL ,
 [ZCHG_USER] nvarchar(12) NULL  DEFAULT NULL,
 [ZCHG_FLAG] nvarchar(18) NULL  DEFAULT NULL,
 PRIMARY KEY (UGET_CODE,REFX_CODE)
);

